Single-lens reflex (SLR) and digital single-lens reflex (DSLR) cameras have large aperture optics which can produce a narrow depth of field. Depth of field measures the distance from the nearest object to the camera which is in focus, to the farthest object from the camera which is in focus. (D)SLR cameras typically have a depth of filed of order significantly less than 1 meter for a typical portrait scenario of a subject a few meters from the camera. This allows the foreground subject of a photo to be rendered in sharp focus, while the background is blurred by defocus. The result is visually pleasing as it provides a separation between the subject and any distracting elements in the background. The aesthetic quality of background blur (encompassing both the quantity and “look” of the blur) is known as bokeh. Bokeh is especially important for photos of people, or portraits.
Compact digital cameras are more popular than DSLRs with consumers because of their smaller size, lighter weight, and lower cost. However, the smaller optics on a compact camera produce a large depth of field, of order greater than approximately 1 meter for the same typical portrait scenario, which renders the background in typical portrait shots as sharp and distracting.
Depth of field varies significantly depending on the geometry of the photographic scene. The following examples are for taking a photo of a person about 3 meters from the camera:
(i) the depth of field for a full frame SLR camera at 50 mm focal length and aperture f/2.8 is about 0.5 meters. For a portrait scenario, a photographer would typically want to use a depth of field this size, or even smaller, maybe 0.2 meters or even 0.1 meters. An SLR camera can also be configured with a smaller aperture to achieve very large depth of field, though this is not usually done for portraits.
(ii) the depth of field for a small compact camera (e.g. Canon™ IXUS™ model) at 50 mm full-frame equivalent focal length and aperture f/2.8, is 6 meters.
(iii) a large compact camera (e.g. Canon™ G12) at 50 mm full-frame equivalent focal length and aperture f/4 is 1.6 meters. (This camera cannot achieve f/2.8 aperture—if it could, its depth of field would be 1.2 meters.) It is practically impossible for a camera with a compact form factor to achieve a depth of field under about 1 meter, for a subject at 3 meters distance. Technically, such is possible, but would require very large and expensive lenses. Depth of field for compact cameras under normal conditions can easily be tens of meters or even infinity, meaning that everything from the subject to the far distance is in focus.
If the person is closer to the camera than 3 meters, all the depth of field distances discussed above will be smaller, and if the person is further away, they will all be larger. Importantly, an SLR camera will always be able to achieve a significantly smaller depth of field than a compact camera. The depth of field is largely dictated by the size of the camera sensor.
A method of producing artificial bokeh with a compact camera, mimicking the amount and quality of background blur produced by an SLR camera, would provide a major improvement in image quality for compact camera users.
Camera manufacturers and professional photographers have recognised the depth of field limitations of small format cameras for decades. With the advent of digital camera technology, it has become feasible to process camera images after capture to modify the appearance of the photo. The generation of SLR-like bokeh from compact camera images has been an early target for research in the field of digital camera image processing. However, no solution providing results of high (i.e. visually acceptable) aesthetic quality has been demonstrated.
To accurately mimic small depth of field given a large depth of field photo, objects in the image must be blurred by an amount that varies with distance from the camera. The most common prior approach tackles this problem in two steps:                (1a). Estimate the distance of regions in the image from the camera to produce a depth map.        (1b). Apply a blurring operation using a blur kernel size that varies with the estimated distance.        
Step (1a) is a difficult problem in itself, and the subject of active research by many groups. The three main methods of depth map estimation from camera images (i.e. excluding active illumination methods) are:
(i) Stereo: taking photos from different camera positions and extracting depth from parallax. A major disadvantage of this approach is the requirement to take photos from multiple viewpoints, making it impractical for compact cameras.
(ii) Depth from focus (DFF): taking a series of many images focused at different distances and measuring in patches which photo corresponds to a best focus at that patch, usually using maximal contrast as the best focus criterion. A major disadvantage of this approach is that many exposures are required, necessitating a long elapsed time. During the exposures the camera or subject may inadvertently move, potentially blurring the subject and introducing additional problems caused by image misalignment.
(iii) Depth from defocus (DFD): quantifying the difference in amount of blur between two images taken with different focus and equating the blur difference to a distance. This is the most suitable approach for implementation in a compact camera, as it does not require stereo camera hardware and can be performed with as few as two photos. However, it has the disadvantages that accuracy is typically relatively low, particularly around the boundaries of objects in the scene, and that consistency is adversely affected by differing object textures in the scene. Some DFD methods show better accuracy around object edges, at the cost of using computationally expensive algorithms unsuited to implementation in camera hardware.
Step (1b) is computationally expensive for optically realistic blur kernel shapes. A fallback is to use a Gaussian blur kernel, which produces a blur that looks optically unrealistic, making the resulting image aesthetically unpleasing.
To more easily approach artificial bokeh, many prior methods use a simplified version of the above two-step method, being:                (2a). Segment the image into a foreground region and a background region.        (2b). Apply a constant blurring operation to the background region only.        
Assuming step (2a) is done correctly, step (2b) is straightforward. However, step (2a) is still difficult and has not been achieved satisfactorily within the constraints of a compact camera. In particular, the accuracy of segmentation around the edges of objects at different depths in the scene is poor. Even if this simplified method can be achieved without error, the resulting images can look artificial, since intermediate levels of blur between the foreground and background will be absent.
An alternative approach to artificial bokeh is to:                (3a). Estimate the amount of blur at different places in an image, compared to a blur-free representation of the subject scene.        (3b). Apply a blurring operation using a blur kernel size that varies with the estimated blur amount.        
A compact camera does not have an infinite depth of field, so the background will show a small amount of blurring relative to an in-focus foreground object. If such blurred regions can be identified accurately, they can be blurred more, producing increased blur in the background.
Step (3a) can be performed with a single image, or by using multiple images of the scene captured with different camera parameters. Estimating blur from a single image is under-constrained and can only be achieved under certain assumptions. For example, one assumption is that edges detected in the image are step function edges in the scene, blurred by the camera optics, and that regions away from edges may be accurately infilled from the edge blur estimates. These assumptions are often false, resulting in poor blur estimates. Estimating blur from multiple images is akin to DFF or DFD, because blur amount is directly related to depth, and shares the same problems.